package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import main.AppConfig;
	import main.AppControllerList;
	import main.AppInit;
	
	/**
	 * 主程序类 
	 * @author lipi 
	 */
	public class Main extends Sprite
	{
		public function Main()
		{
			super();
			if(stage) 
			{
				init();
			}
			else
			{
				addEventListener(Event.ADDED_TO_STAGE,addToStage);
			}
		}
		
		/**
		 * 添加到舞台检测 
		 */
		private function addToStage(e:Event):void
		{
			removeEventListener(Event.ADDED_TO_STAGE,addToStage);
			
			init();
		}
		
		
		private function init():void
		{
			AppConfig.getInstance().start();
			AppInit.getInstance().start(); 
			AppControllerList.getInstance().start();

		}

	}
}